Repository navigation
feat(scout-for-lol): fill the public champion and matchup pages' recent changes and tooltips - #5548
Conversation
…nt changes and tooltips Why The public champion page and matchup page shipped with two empty slots: the champion page's "Recent changes" block (the patch-change reader and the RecentChanges component are on main) and the rich tooltips (the layered RichTooltip and the per-entity game-fact files are on main). Nothing on those pages opened a tooltip, and a nerfed core item was invisible. What - The champion page mounts RecentChanges, fed by getRecentChampionChanges over the newest 8 patches with the item ids of the slice's builds (every build path, what follows the core, the boots), so an item nerf shows beside the champion's own lines. Ages are measured from the snapshot's last day so a rebuild writes the same page. No win-rate line (no pipeline yet) and no "See all changes" link (no page lists them). The matchup page has no such block in the mockups and none is added. - One delegated tooltips island (client:idle) on both pages. Elements carry data-game-fact="<kind>/<key>" plus a name (gameFactAttributes in the data package); DelegatedGameFactTooltips listens on the document for the pointer or focus reaching one and mounts a RichTooltip on it. RichTooltip gains a triggerElement for an element the page rendered itself; the trigger rules are shared with the rendered-trigger path. Facts load from the static /assets/scout/game/<patch>/facts files through loadGameFact. No Scout block, since public pages have no viewer. - Marked: champion cards and matchup rows (champions), setup rows (runes, spells, items, skill-order abilities), later-game items and boots, the spell pair on the matchup page, and the item and ability names in Recent changes. Verification - bunx turbo run build typecheck test lint over design-system, data and every dependent (65 tasks); new unit tests for the trigger helpers, the recent changes model (every row in the committed notes names an existing fact file) and the markup; Playwright e2e for the delegated story (hover, hand-over, keyboard focus). - Built the site from the fixture snapshot and fetched all 161 distinct fact files the 175 champion and matchup pages name: all 200. - Not run: live deployment. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
|
This change is part of the following stack:
Change managed by git-spice. |
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Why: the design audit clicks every aria-haspopup=dialog trigger and expects a dialog; a champion card is a link, so the click followed it. A link does not open a dialog, so it should not say it does. What: a page-rendered trigger that is an anchor gets only data-open; other triggers keep aria-haspopup, aria-expanded and aria-controls. The Delegated story and its e2e cover a link. Verification: rich-tooltip e2e (8 passed), design-system build, lint, typecheck. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
Why: the delegated tooltip moves between elements, so aria-haspopup came and went on whichever element held it, and the design audit's dialog-trigger sweep (which counts them once and then revisits them by index) lost its place. The elements are also links, list items and icons, which do not take those states. What: a triggerElement gets data-open while its layer is open and no popup ARIA; rendered triggers are unchanged. The Delegated e2e asserts it. Verification: rich-tooltip e2e (8 passed), design-system build, lint, typecheck. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…es its element Why: a tooltip opened by keyboard focus stayed for the 150 ms pointer grace period after Tab moved on, so a page-wide focus sweep (the design audit's keyboard check) left the last tooltip open, and its own ability buttons joined the audit's dialog-trigger sweep. What: focus leaving the active element unmounts its tooltip unless focus moves into the layer or the pointer is still on the element. New e2e: tabbing hands the tooltip over at once. Verification: rich-tooltip e2e (9 passed), design-system build, lint, typecheck. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…element
Why: moving the matchup page's spell icons into a component left the colon after the second spell as its own text node, which the flex element spaced away ("Teleport :") and which wrapped the sentence, changing the page's height.
What: MatchupSpells takes a suffix that goes into the last spell's own text. The built matchup HTML is otherwise identical to main apart from the data-game-fact attributes and the island.
Verification: compared the normalised HTML of every matchup page between main and this branch (after removing the attributes and the island): identical for the pages checked; frontend typecheck and lint.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…or Recent changes Why: the champion page gained its Recent changes block, so the 16 champion goldens no longer match. What: regenerated the champion route's 16 Chromium baselines (four themes by four viewports) in the pinned ci-playwright image (linux/amd64) from a clone of the branch head, with the fixture snapshot. The matchup and champions-index goldens are untouched: the built matchup HTML of all 124 pages is identical to main apart from the data-game-fact attributes and the island, and the index only gains inert attributes. Verification: design audit for public/champions, public/champion and public/matchup in that image: 54 passed (axe, same-origin errors, keyboard focus, dialog triggers, baselines). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
… and make the audit follow the tooltip Why Dropping aria-haspopup to satisfy the design audit was backwards. The audit's dialog-trigger sweep counted triggers once and revisited them by index, which cannot hold for one tooltip that moves between elements. Auditing the tooltip properly also showed that the first tap on a phone opened nothing, because the click lands before the tooltip has mounted. What - Page-rendered triggers carry aria-haspopup, aria-expanded and aria-controls again (a link too, as a rendered trigger does). - The audit's index sweep skips data-game-fact elements. A new check (tooltip-triggers.ts) takes one trigger per kind, finds each again by its own data-game-fact value, reaches it by hover on desktop or tap on a phone, and expects a dialog with its name, aria-haspopup, and Escape to close it. - The island holds back a click that arrives before its tooltip is listening, mounts the tooltip, and replays the click, so the first tap opens it (a link follows on the second tap). Verification - rich-tooltip e2e (10 passed, including the first-tap case); design-system and design-audit build, lint, typecheck and unit tests. - The audit's public champion and matchup routes pass locally on Chromium desktop and mobile. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…e the island mounts Why ChampionCard marked every card with data-game-fact, including on the champions index, which mounts no tooltip island. The audit's new tooltip check (rightly) found cards there that open nothing. What ChampionCard takes `tooltip`, off by default; the champion page's "More champions" and the matchup page's "against someone else" cards set it. Verification design-system, frontend and app build, typecheck, test and lint; the ChampionCard test covers both states. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
…out the dev toolbar Why The matchup baselines committed with #5428 include Astro's dev toolbar (a floating bar over the "In lane" panel), so they were wrong baselines; CI runs the audit with the toolbar off. What Regenerated all 16 matchup Chromium baselines (four themes by four viewports) in the pinned ci-playwright image (linux/amd64) with CI=true from a clone of the branch, built site, fixture snapshot. This corrects #5428's baselines. The champion baselines regenerated byte-identical to the ones in the previous commit. Verification Design audit for public/champion and public/matchup in that image. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y
|
@codex review Automated re-review request for |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a59518477d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Why
The public champion page and matchup page (#5421, #5428) shipped with two empty slots. The champion page's "Recent changes" block waited on the patch-change reader and component (#5411), and nothing on either page opened a tooltip, which waited on the layered
RichTooltipand the per-entity game facts (#5264). Both are on main now, so a nerfed core item was invisible and every icon was a dead end.What
RecentChangesfed bygetRecentChampionChangesover the newest 8 patches, with the item ids of the slice's builds (every build path, what follows the core, the boots), so an item nerf shows beside the champion's own lines. Ages are measured from the snapshot's last day, so a rebuild of the same snapshot writes the same page. The win-rate before and after line is left out (no pipeline yet) and so is "See all changes" (no page lists every change). A champion the notes never touched shows "No changes in the last 8 patches".client:idle) on both pages. Elements carrydata-game-fact="<kind>/<key>"plus a name (gameFactAttributesin the data package);DelegatedGameFactTooltipslistens on the document for the pointer or focus reaching one and mounts aRichTooltipon it through a newtriggerElement, sharing the trigger rules with the rendered-trigger path. Facts load from the static/assets/scout/game/<patch>/facts/<kind>/<key>.jsonthroughloadGameFact. No Scout block: public pages have no viewer. Marked: champion cards and matchup rows, setup rows (runes, spells, items, skill-order abilities), later-game items and boots, the spell pair on the matchup page, and the item and ability names in Recent changes. Marked elements that a keyboard cannot reach gettabindex="0". A link keeps being a link on a phone (first tap shows the layer, second follows it); anything else opens the bottom sheet. Page-rendered triggers carryaria-haspopup,aria-expandedandaria-controlslike a rendered trigger. The first tap on a phone opens the tooltip: the island holds back a click that lands before the tooltip has mounted and replays it. Tabbing away dismisses the tooltip at once; a pointer keeps the grace period.ChampionCardmarks itself as a trigger only when giventooltip, so the champions index (no island) stays unmarked.MatchupPagehas no mount point for one, so it is on the champion page only; the matchup page gets the tooltips.Demo
Champion page, Syndra (has changes in 26.23 and 26.18), from the built fixture site. Recent changes is the new block; the tooltips are invisible until hovered.
Ahri, whom the notes never touched (the design-audit route), and the matchup page, which only gains tooltips:
Tooltips open, from the same build: an item in the core build (dark, 1440), a champion row (dark, 1440), an ability name in Recent changes, a rune (light, 1440), and the same item as a bottom sheet at 390.
Verification
bunx turbo run build typecheck test lintover design-system, data and every dependent (65 tasks, all green), then again at the final head over design-system, frontend, data, app and design-audit (all green);bun run jscpd(baseline ratchet passed);bun run check-directory-file-counts; lefthook pre-commit.SetupRowandChampionCard(design-system), and theDomain/EntityTooltip→Delegatedstory with Playwright e2e for hover, hand-over between elements, keyboard focus, Tab hand-over and Escape (rich-tooltip.spec.ts, 10 passed, including the first tap on a phone).astro build) and fetched the fact file behind everydata-game-facton the 175 champion and matchup pages: 161 distinct URLs, all HTTP 200 (/assets/scout/game/16.23.1/facts/<kind>/<key>.jsonships indistthroughcopyScoutAssets). Hover, the item and champion tooltips, and the phone sheet were driven in the browser against that build.[aria-haspopup="dialog"]once and revisited them by index, which cannot hold for one tooltip that moves between triggers. It now skipsdata-game-factelements, and a new check (design-audit/src/tooltip-triggers.ts, unit-tested) takes one trigger per kind, finds each again by its owndata-game-factvalue on every visit, reaches it by hover (desktop) or tap (phone), and expects a dialog with its name andaria-haspopup, then Escape closes it.ci-playwrightimage (linux/amd64, the digest inci/ci-playwright/DIGEST), from a clean clone of the branch head, fixture snapshot,CI=true, with the/trpc/auth.sessionStaterequest the navbar makes answered by a stub (no backend started):public/champions,public/championandpublic/matchupacross all themes and viewports compared against the committed baselines at the final head, 54 passed (axe, same-origin errors, keyboard focus indicators, dialog and tooltip triggers, baselines). Baselines: the champion route's 16 Chromium goldens are updated (the new block), and all 16 matchup goldens are regenerated. This corrects feat(scout-for-lol): add the public matchup page #5428's matchup baselines: the ones committed there include Astro's dev toolbar (a floating bar over the "In lane" panel), and CI runs the audit with it off. The built HTML of all 124 matchup pages is identical to main apart from thedata-game-factattributes and the island, so the matchup change here is the corrected baseline, not a layout change. The champions index goldens are untouched and pass.tier: "extended"steps.🤖 Generated with Claude Code
https://claude.ai/code/session_011u9pQk6p4o3DxofkiZXg8y